package com.demo.sayhelloworld.say;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;

@RestController
public class SayDemo2 {


    private RestTemplate restTemplate = new RestTemplate();


    @RequestMapping("/t2")
    public String testRefresh() throws Exception{


        String s = restTemplate.postForObject(new URI("http://localhost:8085/actuator/refresh"),
                new HashMap<>(), String.class);
        System.out.println(s);

         return "刷新配置refresh输出  "+s;
    }
}
